package com.ruoyi.service.company.enums;

import lombok.Getter;

/**
 * <p>
 * 作用：区域等级
 * </p>
 *
 * @author Zane
 * @since 2025-10-05 21:15
 */
@Getter
public enum CheckStatusEnum {
  /**
   * 元/天；
   */
  CHECKING(0, "待审核"),
  /**
   * 元/条
   */
  PASSED(1, "通过"),
  /**
   * 元/页
   */
  DENIED(2, "拒绝");
  /**
   * 编码
   */
  private final int code;
  /**
   * 描述
   */
  private final String desc;

  CheckStatusEnum(int code, String desc) {
    this.code = code;
    this.desc = desc;
  }

  public boolean eqCode(int code) {
    return this.code == code;
  }

  public static boolean isPassed(int code) {
    return PASSED.eqCode(code);
  }

  public static CheckStatusEnum valueOfCode(int code) {
    for (CheckStatusEnum value : values()) {
      if (value.eqCode(code)) {
        return value;
      }
    }
    throw new IllegalArgumentException("公司状态不合法:" + code);
  }
}
